package com.yuexun.beilunpatient.ui.activity.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yuexun.beilunpatient.R;
import com.yuexun.beilunpatient.base.BaseKJActivity;
import com.yuexun.beilunpatient.widget.FixedSwipeListView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by chenss on 2018/4/11 0011.
 */

public class Act_Activity_Detail extends BaseKJActivity {

    @Bind(R.id.signLog)
    TextView signLog;
    @Bind(R.id.theme)
    TextView theme;
    @Bind(R.id.area)
    TextView area;
    @Bind(R.id.unit)
    TextView unit;
    @Bind(R.id.initiator)
    TextView initiator;
    @Bind(R.id.department)
    TextView department;
    @Bind(R.id.position)
    TextView position;
    @Bind(R.id.start_time)
    TextView startTime;
    @Bind(R.id.type)
    TextView type;
    @Bind(R.id.value)
    TextView value;
    @Bind(R.id.activity_time)
    TextView activityTime;
    @Bind(R.id.apply_time_scope)
    TextView applyTimeScope;
    @Bind(R.id.activity_location)
    TextView activityLocation;
    @Bind(R.id.activity_content)
    TextView activityContent;
    @Bind(R.id.flv_attachment)
    FixedSwipeListView flvAttachment;
    @Bind(R.id.ll_extra_file)
    LinearLayout llExtraFile;
    @Bind(R.id.apply_time)
    TextView applyTime;
    @Bind(R.id.stateView)
    TextView stateView;

    int stat;

    @Override
    public void setRootView() {
        setContentView(R.layout.act_activity_detail);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {
        stat = getIntent().getIntExtra("stat", 1);
        if(stat == 1){
            signLog.setVisibility(View.GONE);
            stateView.setText("报名");
            stateView.setBackgroundColor(getResources().getColor(R.color.main_text_02));
            applyTime.setVisibility(View.GONE);
        }else if(stat == 2){
            signLog.setVisibility(View.GONE);
            stateView.setText("签到");
            stateView.setBackgroundColor(getResources().getColor(R.color.main_text_02));
            applyTime.setVisibility(View.VISIBLE);
        }else if(stat == 3){
            signLog.setVisibility(View.VISIBLE);
            stateView.setText("签到");
            stateView.setBackgroundColor(getResources().getColor(R.color.main_text_02));
            applyTime.setVisibility(View.VISIBLE);
        }else if(stat == 4){
            signLog.setVisibility(View.GONE);
            stateView.setText("报名过期/活动过期");
            stateView.setBackgroundColor(getResources().getColor(R.color.gray));
            applyTime.setVisibility(View.GONE);
        }

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.title_back, R.id.signLog, R.id.stateView})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.title_back:
                finish();
                break;
            case R.id.signLog:
                break;
            case R.id.stateView:
                break;
        }
    }
}
